package org.idea.qiyu.framework.canal.client;

import com.alibaba.otter.canal.protocol.CanalEntry;
import org.idea.qiyu.framework.canal.annotation.CanalListener;
import org.idea.qiyu.framework.canal.handle.AbstractCanalHandler;
import org.springframework.stereotype.Component;


/**
 * @Author linhao
 * @Date created in 4:15 下午 2021/6/19
 */
@CanalListener(table = "t_user",destination = "example")
@Component
public class CanalUserListener extends AbstractCanalHandler {

    @Override
    public void onDelete(CanalEntry.RowChange rowChange) {
        super.onDelete(rowChange);
        System.out.println(rowChange);
    }

    @Override
    public void onUpdate(CanalEntry.RowChange rowChange) {
        super.onUpdate(rowChange);
        System.out.println(rowChange);
    }

    @Override
    public void onInsert(CanalEntry.RowChange rowChange) {
        super.onInsert(rowChange);
        System.out.println(rowChange);
    }
}
